package com.henu.engineer.dao.mapper.testpaper

import com.henu.engineer.dao.entity.testpaper.TestPaperDtl
import org.apache.ibatis.annotations.Mapper
import org.springframework.stereotype.Repository

/**
 * 试卷审批支撑关系表
 *
 * @author noexcept
 * @date 2021/8/7 10:11
 */
@Mapper
@Repository
interface TestPaperDtlXmlMapper {
    fun insertSingle(testPaperDtl: TestPaperDtl): Boolean
    fun insertList(testPaperDtls: List<TestPaperDtl>): Int
    fun deleteSingle(testPaperId: String, questionNum: String): Boolean
    fun deleteList(testPaperId: String, questionNums: List<String>): Int
    fun updateScore(testPaperId: String, questionNum: String, score: Double): Boolean
    fun updateCourseGoalId(testPaperId: String, questionNum: String, courseGoalId: Int): Boolean

    /**
     * 查询某张试卷上的某道题
     * @param testPaperId
     * @param questionNum
     * @return
     */
    fun selectTestPaperDtl(testPaperId: String, questionNum: String): TestPaperDtl?

    /**
     * 查询某个试卷上的多道题
     * @param testPaperId 试卷id
     * @param questionNums 题号集合
     */
    fun selectPaperDtlList(testPaperId: String, questionNums: List<String>): List<TestPaperDtl>

    /**
     * 查询某个试卷的所有题
     */
    fun selectByTestPaperId(testPaperId: String): List<TestPaperDtl>
}